package system.controller;

import common.controller.base.BaseController;
import common.model.response.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import system.model.request.SaveUserConfigRequest;
import system.service.SysWebConfigService;

import javax.annotation.Resource;

/**
 * 网站配置管理
 *
 * @author 米泽鹏
 * @since 2022-03-11
 */
@Api(tags = "网站配置管理")
@RestController
@RequestMapping("/system/sys-web-config")
public class SysWebConfigController extends BaseController {

	@Resource
	private SysWebConfigService webConfigService;

	@ApiOperation(value = "保存用户网站配置", notes = "保存用户网站配置", response = Result.class)
	@PostMapping("/saveUserConfig")
	public Result<?> saveUserConfig(@ApiParam(value = "保存用户网站配置请求", required = true) @RequestBody @Validated SaveUserConfigRequest request) {
		return webConfigService.saveUserConfig(request);
	}

}
